<!DOCTYPE html>
<html lang="zh-cn">
<head>
    <title>会议视频表</title>
    <?php require 'templates/common/head.html'; ?>
    <link href="../business/resource/css/hermes.css" rel="stylesheet">
    <link href="../business/resource/js/calendar/calendar-blue.css" type="text/css" rel="stylesheet">
    <script src="../business/resource/js/calendar/calendar.js" type="text/javascript"></script>
    <script src="../business/resource/js/hermes.js"></script>
    <style type="text/css">
        .divleft{width: 10%; float: left; text-align:center; border-right: solid 1px #d5d5d5; margin-right: 2% }
        .divleft2{width: 8%; min-width: 8%;min-height: 10px; float: left; text-align:center; border-right: solid 1px #d5d5d5; margin-right: 0% }
        .divright{  float:right; text-align: center;}
        .divleft3{ width: 10%;  min-width: 10%; min-height: 10px;float: left; text-align:center;  border-right: solid 1px #d5d5d5; margin-right: 2% }

    </style>

</head>
<body>


<div class="container-fluid">
    <?php require 'templates/common/nav.html'; ?>
    <div class="panel panel-primary">
        <div class="panel-heading text-center"><h3 class="panel-title">会议</h3></div>
        <div class="panel-body" style="font-size: 18px;">

            <a href="<?=$url_form?>" type="button" class="btn btn-primary">添加会议</a>

            <a href="<?=$registration_list_url?>" type="button" class="btn btn-primary">会议报名</a>
          <!--  <a href="<?=$ico_url?>" type="button" class="btn btn-primary">添加ico</a>-->
            <div class=" text-right">
                测试openID: <input type="text" id="oid">
            </div>
        </div>

        <div class="panel-body">
            <div class="panel-group"   id="accordion" role="tablist" aria-multiselectable="true">
                <div class="panel panel-default" >
                    <div class="panel-heading" style="background-color:#d5d5d5" >
                        <div class="row">
                            <div class="col-xs-4 text-justify" style="width:100%;">
                                <div class="divleft"><b >图片</b></div>
                                <div class="divleft2"><b >会议名称</b></div>
                                <div class="divleft2"><b  >会议时间</b></div>
                                <div class="divleft2"><b  >会议地点</b></div>
                                <div class="divleft2"><b  >主办单位</b></div>
                                <div class="divleft2"><b  >是否建讨论组</b></div>
                                <div class="divleft3"><b  >状态</b></div>
                                <div class="divleft2"><b  >二维码</b></div>

                                <div class="divright"><b  >操作</b></div>

                            </div>
                        </div>
                    </div>
                </div>
                <div class="panel panel-default">
                    <?php foreach($meet_res as $key => $value):?>
                        <div class="panel-heading"  style=" <?php if($key%2==0){echo "background-color:#DFF0D8;";}else{ echo "border-top: solid 2px #ffffff;";}?>">
                            <div class="row">
                                <div class="col-xs-4 text-justify" style="width:100%;">
                                    <div class="divleft">
                                        <img  width="60px" height="60px" src="<?=G_SITE_BASE?>/<?= $value['图片log'] ?>" title="<?=G_SITE_BASE?>/<?= $value['图片log'] ?>"/>
                                            </div>
                                    <div class="divleft2"><span><?= $value['name'] ?></span></div>
                                    <div class="divleft2"><span><?= $value['会议时间'] ?></span></div>


                                    <div class="divleft2"><span><?= $value['会议地点'] ?></span></div>
                                    <div class="divleft2"><span><?= $value['主办单位'] ?></span></div>

                                    <div class="divleft2"><span><?php  echo  $value['is_create_group']==1?'是':'否' ?></span></div>
                                    <div class="divleft3"><span><?= $value['状态'] ?></span></div>

                                    <?php if(count($value['qrcode'])>1):?>
                                    <div style=" float: left;  max-width:320px;min-height: 60px" id="qrcode">
                                     <?php foreach($value['qrcode'] as $qk =>$qv):?>

                                       <img  width="60px" height="60px" src="<?=G_SITE_BASE?>/cache/wxqrcode/<?=$qv?>.jpg"/>

                                     <?php endforeach;?>    </div>
                                    <?php else:?>
                                    <div id="qrcode" class="divleft2"><span><?php if($value['qrcode'][0]): ?><img  width="60px" height="60px" src="<?=G_SITE_BASE?>/cache/wxqrcode/<?=$value['qrcode'][0] ?>.jpg"/><br/><?=$value[username]?><?php else:?>没有二维码<?php endif;?></span></div>
                                        <?php endif;?>




                                    <div class="divright">
                                        <span> <a class="btn btn-primary btn-xs" href="<?=$url_form?>&id=<?= $value['id']?>">编辑</a></span>
                                        <span> <a class="btn btn-primary btn-xs" href="<?=$video_list_url?>&id=<?= $value['id']?>">视频</a></span>
                                        <span> <a class="btn btn-primary btn-xs" href="<?=$meet_data_list?>&id=<?= $value['id']?>">会议资料</a></span>
                                        <button onclick="disabled=true;tuisong('<?=$value['id']?>')" class="btn btn-primary btn-xs">推送</button>
                                        <?php if($value['video_count'] > 0):?>
                                        <button onclick="disabled=true;vedio_tuisong('<?=$value['id']?>')" class="btn btn-primary btn-xs">视频上线推送</button>
                                        <?php endif;?>
                                       </div>

                                </div>
                            </div>
                        </div>
                    <?php endforeach; ?>

                </div>
            </div>
        </div>
        <?=  $page->showpage()?>
    </div>

</div>

<!-- jQuery (necessary for Bootstrap's JavaScript plugins) -->
<script src="../business/resource/js/jquery-1.11.1.min.js"></script>
<!-- Include all compiled plugins (below), or include individual files as needed -->
<script src="../business/resource/js/bootstrap.min.js"></script>
<script language="JavaScript">
$("#qrcode img").click(function(){
    var src = $(this).attr('src');
    window.open(src) ;

});

function tuisong(id){
    var oid=$("#oid").val();
    var res;
    if (oid) {
        res = confirm("您确定给’"+oid+"’推送消息吗?");
    } else {
        res = confirm("您确定给全部用户推送消息吗？");
    }

    if (res) {
        $.post('index.php?m=meet_manager&a=push_meet_message',{'id':id,'oid':oid},function(data){
            var res= eval('(' + data + ')');
            alert(res.message);
            location.reload();
        });
    }

}

function vedio_tuisong(id){
    var oid=$("#oid").val();
    var res;
    if (oid) {
        res = confirm("您确定给’"+oid+"’推送消息吗?");
    } else {
        res = confirm("您确定给全部用户推送消息吗？");
    }

    if (res) {
        $.post('index.php?m=meet_manager&a=push_meet_video_message',{'id':id,'oid':oid},function(data){
            var res= eval('(' + data + ')');
            alert(res.message);
            location.reload();
        });
    }

}
</script>
</body>
</html>